package com.smart.enums;

public enum EcpObtainTypeEnum {
    BUY("1","卡券商城购买"),
    OIL_SEND("2","加油站派送服务券"),
    NO("3","无券"),
    OIL_GIVE("4","加油站派送实物券");

    private String code;
    private String name;
    EcpObtainTypeEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getName(String code){
        for (EcpObtainTypeEnum obj : EcpObtainTypeEnum.values()) {
            if(obj.getCode().equals(code)){
                return obj.getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
